home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: newsfeed.internetmci.com!miwok!linex1!news
- From: mfried@linex.com (Marty Fried)
- Subject: Re: Begging for help! Desperate!
- X-Nntp-Posting-Host: sp91.linex.com
- Message-ID: <316dca90.4800529@news.linex.com>
- Sender: news@linex1.linex.com
- Organization: Cirrius Cybernetics Corp
- X-Newsreader: Forte Agent .99e/32.201
- References: <4k4il4$ccr@cronkite.seas.gwu.edu> <N.040696.101312.44@ix.netcom.com>
- Date: Fri, 12 Apr 1996 03:18:08 GMT
-
- Once upon a time (OK, it was Sat, 06 Apr 96 18:13:12 GMT),
- jhewett@ix.netcom.com (Jerry Hewett) wrote:
-
- >Karim P. Draoui <kelly@seas.gwu.edu> asks:
- >
- >> I am trying to close a window in a program I am creating in Borland C++ 4.5.
- >> Basically what I am trying to do is open another window and close the current
- >> window. I am having problems though using the CloseWindow function. I am
- >> able to open another window, but I cannot close the current window. I have
- >> used the books that come with Borland, but with no luck. Anyways, if anyone
- >> can help me out as soon as possible I would really appreciate it.
- >
- >If I could look at your code I might be able to help you out with this. At
- >this point I'm guessing that the windows in question are child windows and not
- >the parent window for your application (which would explain why things aren't
- >quite working right :-). If so, try trapping on the WM_CLOSE case in your
- >WinProc and sending out a DestroyWindow command. You'll still need to send the
- >WM_CLOSE message to your window, though:
- >
- > SendMessage (handle_to_your_first_window,WM_CLOSE,0,0);
- > .
- > .
- > .
- > case WM_CLOSE:
- > DestroyWindow (handle_to_your_first_window);
- > handle_to_your_first_window = 0;
- > break;
- >
- What is the purpose of the SendMessage? Why wouldn't you handle the
- WM_CLOSE message normally? Doing the SendMessage seems to me to be
- more work.
-
- Otherwise, I think your answer is correct (assuming he wants to
- destroy the window, and not just hide it).
-
- _______________________________________________________
- Marty Fried - mfried@linex.com Press Enter to Exit
- San Anselmo, CA -NT message
- (MSVC4 + MFC) && (Win95 || NT);
-